package com.cloudlead.common.worker.desc.datatype;

import com.fasterxml.jackson.annotation.JsonTypeName;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

@JsonTypeName("seq")
public class SeqData extends ComplexData {
    protected Collection<FormData> sequence;

    public Collection<FormData> getSequence() {
        return sequence;
    }

    public void setSequence(Collection<FormData> sequence) {
        this.sequence = sequence;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        if (null == this) {
            return null;
        }
        SeqData clone = (SeqData) super.clone();
        if (null != sequence) {
            List<FormData> cloneSequence = new ArrayList<>();
            for (FormData formData : sequence) {
                cloneSequence.add((FormData) formData.clone());
            }
            clone.sequence = cloneSequence;
        }
        return clone;
    }
}
